package com.hziee.mail.model;

import javax.persistence.*;
import java.util.Objects;

/**
 * @author ZX
 */
@Entity
@Table(name = "order_info_temporary", schema = "mall", catalog = "")
public class OrderInfoTemporaryEntity {
    private int id;
    private Integer userId;
    private String goodsId;
    private Double price;
    private Integer value;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_id")
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "goods_id")
    public String getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    @Basic
    @Column(name = "price")
    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    @Basic
    @Column(name = "value")
    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrderInfoTemporaryEntity that = (OrderInfoTemporaryEntity) o;
        return id == that.id &&
                Objects.equals(userId, that.userId) &&
                Objects.equals(goodsId, that.goodsId) &&
                Objects.equals(price, that.price) &&
                Objects.equals(value, that.value);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, goodsId, price, value);
    }
}
